package app.tool;

import wsi.function.Function;
import wsi.function.FunctionController;
import wsi.script.AppConfig;
import wsi.ws.WebServices;
import app.App;

public class resetFunctions extends App {

	public static void main(String... args) {
		init();
		AppConfig.init();

		String[][] values = {
		/**/{ "SKIP.INPUT", "true" },
		/**/{ "SKIP.DATA_GUIDE", "true" },
		/**/{ "SKIP.TYPE", "true" },
		/**/{ "SKIP.REST", "false" },
		/**/{ "SKIP.LOCATE_INPUT", "true" },
		/**/{ "SKIP.YAGO_HOP", "true" },
		/**/{ "SKIP.MAPPING", "true" },
		/**/{ "SKIP.FUNC_XPATH", "true" },
		/**/{ "SKIP.SUBTREE_MAPPING", "true" },
		/**/{ "SKIP.RESOLVE", "true" },
		/**/{ "SKIP.TRIPLES", "true" },
		/**/{ "SKIP.FUNC_DEF", "true" },
		/**/{ "SKIP.MEASURE", "true" }, };

		modify(values);
		bye();
	}

	public static void modify(String[][] values) {
		resetFunctions app;

		for (WebServices service : WebServices.values()) {
			app = new resetFunctions(service.name(), values);
			app.run();
		}
	}

	private final String[][] values;

	public resetFunctions(String service, String[][] values) {
		this.values = values;
	}

	private void run() {

		for (Function f : FunctionController.shared().getAllFunctions()) {

			for (String[] s : values)
				f.update(s[0], s[1]);

			f.save();
		}

	}

}
